﻿using Avalonia.Controls;

namespace LiftHub.Services;

public static class ViewService
{
    public static T? GetView<T>(Control? control) where T : Control
    {
        while (true)
        {
            if (control == null) return default;
            if (control is T view) return view;
            control = control.Parent as Control;
        }
    }
}